import React, { useEffect, useState } from 'react'
import axios from 'axios'
import { useRequest } from 'ahooks'

export default function UseRequest() {
    const { data,error,loading} = useRequest(() => {
        return axios.get('https://api.uomg.com/api/rand.qinghua', {
            format: 'json',
        })
    },{
        pollingInterval:1000
    })
    return (
        <div>{loading? '正在加载' : data?.data?.content}</div>
    )
}
